﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InductBase;
using SharpBolt.Graphics;

namespace SharpBolt.Graphics.Particles
{
    public struct ParticleStateNode
    {
        public double Speed { get; set; }
        public Vec2 Scale { get; set; }
        public double Angle { get; set; }
        public DColor DColor { get; set; }      

        public static ParticleStateNode GetStateByPart(double part, ParticleStateNode stateA, ParticleStateNode stateB)
        {
            ParticleStateNode result = new ParticleStateNode();
            
            result.Speed = stateA.Speed + part * (stateB.Speed - stateA.Speed);
            result.Scale = stateA.Scale + part * (stateB.Scale - stateA.Scale);
            result.Angle = stateA.Angle + part * (stateB.Angle - stateA.Angle);
            result.DColor = DColor.LinearTween(stateA.DColor, stateB.DColor, part);

            return result;
        }
    }
}
